package cn.cdg.mall.controller;

import cn.cdg.mall.pojo.po.PersonPO;
import cn.cdg.mall.pojo.po.UpPO;
import cn.cdg.mall.pojo.po.UserPO;
import cn.cdg.mall.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/person")
public class PersonController {
    @Autowired
    private PersonService personService;

    @RequestMapping(value = "/addPerson")
    public boolean addPerson(@RequestBody PersonPO person) {

        return personService.addPerson(person);
    }

    @RequestMapping(value = "/addUp")
    public boolean addUp(@RequestBody UpPO up) {

        return personService.addUp(up);
    }

    @RequestMapping("/person-all")
    public List<PersonPO> selectAllPerson(@RequestBody UserPO userPO) {

        return personService.selectAllPerson(userPO);
    }
    @RequestMapping("/up-all")
    public List<UpPO> selectAllUp() {

        return personService.selectAllUp();
    }
}
